﻿using System.ComponentModel;
using System.Data;
using System.Windows;
using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using WPFExcelReport.Helpers;
using System.Windows.Controls;
namespace WPFExcelReport
{
    public partial class EK02
    { 
        public EK02()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VEKKOPF();
            DataContext = MV;  
            InitializeComponent(); 
        }
        public override void LOADBYAUF()
        {
            if (ORDERNUM.Length < 8) return;
            KRS = ORDERNUM.Substring(0, 2);
            LFD = ORDERNUM.Substring(2, 6);
            base.LOADBYAUF();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            dwEKK = dwMaster;
            if (dwMaster == null)
            {
                KEY = "";
                AUF = "";
            }
            else
            {
                KEY = dwMaster["EKKAUFKRS"].ToString() + dwMaster["EKKAUFLFD"].ToString();
                AUF = "B" + dwMaster["EKKAUFKRS"].ToString() + dwMaster["EKKAUFLFD"].ToString() + "000" + LIEFNR.PadRight(8);
            }
        }
        public override void OnAppModeChg()
        {
            
        }
    }
}
